#include <stdio.h>

int hammingWeight(int n)
{
    int count = 0;
    while(n != 0)
    {
        if((n << 31) != 0)
        {
            count++;
            n >>= 1;
        }
        else
        {
            n >>= 1;
        }
    }
    return count;
}

int main()
{
    int n = 11;
   printf("%d\n",hammingWeight(n));
    return 0;
}